package com.luych.toolbox.automation.service.dao;

import com.luych.toolbox.automation.service.entity.AutoSshServer;
import com.luych.toolbox.common.enums.AutoSshServerStatus;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;

public interface AutoSshServerDao extends JpaRepository<AutoSshServer, String>, JpaSpecificationExecutor<AutoSshServer> {

    Optional<AutoSshServer> findByName(String name);

    List<AutoSshServer> findByStatus(AutoSshServerStatus status);

    Page<AutoSshServer> findByNameLikeOrHostLike(String name, String url, Pageable pageable);

}